﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Configuration;

namespace L2C.Controllers
{
    public class PageController : Controller
    {
        L2CEntities entities = new L2CEntities(ConfigurationManager.ConnectionStrings["L2CEntities"].ToString());

        public ActionResult Index(int? itemId, string caption = "")
        {
            var data = entities.StaticContents.Where(x => x.ID == itemId).Select(x => new L2C.Models.ContentPage { ID = x.ID, Title = x.Title, Content = x.MainContent}).SingleOrDefault();
            return View(data);
        }

    }
}
